package com.aispeech.asr.apis.ssc.metrics;

import com.aispeech.asr.comm.metrics.MetricsBase;
import io.prometheus.client.Counter;
import io.prometheus.client.Gauge;
import io.prometheus.client.Summary;

public class Prometheus extends MetricsBase {
    public static final Gauge GAUGE_N_CONCURRENCY_TASKs = Gauge.build()
            .name("gauge_n_task_concurrency")
            .labelNames("env", "hostName", "productId")
            .help("gauge_n_task_concurrency")
            .register();

    public static final Counter COUNTER_TASK_REQUESTS = Counter.build()
            .name("counter_task_requests")
            .labelNames("env", "hostName", "productId", "status")
            .help("counter_task_requests")
            .register();

    public static final Summary SUMMARY_TASK_REAIL_RATE = Summary.build()
            .name("summary_task_real_rate")
            .labelNames("env", "hostName")
            .quantile(0.5, 0.5)
            .quantile(0.95, 0.95)
            .help("summary_task_real_rate")
            .register();

    public static final Summary SUMMARY_TASK_REAIL_RATE_LESS = Summary.build()
            .name("summary_task_real_rate_less")
            .labelNames("env", "hostName")
            .quantile(0.5, 0.5)
            .quantile(0.95, 0.95)
            .help("summary_task_real_rate_less")
            .register();

    public static final Counter COUNTER_TASK_API_REQUESTS = Counter.build()
            .name("counter_task_api_requests")
            .labelNames("env", "hostName", "productId", "action")
            .help("counter_task_api_requests")
            .register();
}
